<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition>
            <p:panel header="Edit My Profile" visible="true"> 
    <center class="body">
    <h:form id="EditForm">
        
       
        <h:panelGrid columns="3">
            <h:outputText style="color: #AFAFAF;font-weight: bolder;" value="Personal Information"/>
            <h:outputText value=""/>
            <h:outputText value=""/>
            
            <h:outputText value="____________________________"/>
            <h:outputText value="____________________________"/>
            <h:outputText value=""/>
            
          
            <h:outputText value="User Name "/>
            <h:outputText styleClass="textfield" value="#{userBean.user.uid}" id="username"/>                    
            <h:outputText value=""/>
            
            <h:outputText value="Contact Person"/>
            <h:inputText styleClass="textfield" value="#{userBean.user.contact}" id="contact" required="true" requiredMessage="Contact Person must not be blank">
                <f:validateLength minimum="4" maximum="50"/>
            </h:inputText>
            <h:message for="contact" style="color : red"/>
            
            <h:outputText value="City"/>
            <h:selectOneMenu value="#{userBean.user.cityid}">
                <f:selectItems value="#{comboBox.items}"/>                  
                </h:selectOneMenu>
            <h:outputText value="" />
            
           <h:outputText value="Mobile "/>
           <h:inputText styleClass="textfield" value="#{userBean.user.mobile}" id="mobile" required="true" requiredMessage="Mobile must not be blank">
               <f:validator validatorId="mobileValidate"/>
            </h:inputText>
            <h:message for="mobile" style="color : red"/>
            
            <h:outputText value="Telephone"/>
            <h:inputText styleClass="textfield" value="#{userBean.user.tele}" id="telephone" required="true" requiredMessage="Telephone must not be blank">
                <f:validator validatorId="teleValidate"/>
            </h:inputText>
            <h:message for="telephone" style="color : red"/>
                        
            <h:outputText value="Address"/>
            <h:inputText styleClass="textfield" value="#{userBean.user.address}" id="address" required="true" requiredMessage="Address must not be blank">
                <f:validateLength minimum="4" maximum="20"/>
            </h:inputText>
            <h:message for="address" style="color : red"/>
            
            <h:outputText value="Email"/>
            <h:inputText styleClass="textfield" value="#{userBean.user.email}" id="email" required="true" requiredMessage="Email must not be blank">
                <f:validator validatorId="emailValidate"/>                
            </h:inputText>
            <h:message for="email" style="color : red"/>
            
             
                       
            <h:outputText style="color: #AFAFAF;font-weight: bolder;" value="Change My Password"/>
            <h:outputText  value=""/>
            <h:outputText value=""/>
            
            <h:outputText value="____________________________"/>            
            <h:outputText value="____________________________"/>               
            <h:outputText value=""/>   
            
            <h:outputText value="Old Password"/>
            <h:inputSecret styleClass="textfield" value="#{userBean.user.oldpwd}" id="old" required="true" requiredMessage="Confirm Password must not be blank">
                <f:validateLength minimum="4" maximum="50"/>
            </h:inputSecret>
            <h:message for="old" style="color : red"/>
            
            <h:outputText value="Password"/>
            <p:password id="password" value="#{userBean.user.newpwd}" feedback="true" minLength="3" strongLabel="Good password" required="true" requiredMessage="Password must not be blank">
                <f:validateLength minimum="4" maximum="50"/>
            </p:password>
            <h:message for="password" style="color : red"/>
            
            <h:outputText value=" Confirm Password"/>
            <h:inputSecret styleClass="textfield" value="#{userBean.user.confirmnew}" id="confirm" required="true" requiredMessage="Confirm Password must not be blank">
                <f:validateLength minimum="4" maximum="50"/>
            </h:inputSecret>
            <h:message for="confirm" style="color : red"/>
            
            <f:facet name="footer">
                <h:panelGroup style="display:block; text-align:center;">  
            <h:commandButton value="Edit My Account" action="#{userBean.edit}" onclick="if (!confirm('Your profile will be changed .Are you sure ?')) return false"/>   
                </h:panelGroup>
            </f:facet>
                        
        </h:panelGrid>
            
    </h:form>
       
    </center>
        </p:panel>
        </ui:composition>
    </h:body>
</html>

